const path = require('path');
const fs = require('fs');

// 获取routes/下面的所有ts文件
const files = fs.readdirSync(path.resolve(__dirname, './routes'));
const Routes = files
  .filter((file) => file.endsWith('.ts')) 
  .flatMap((file) => {
    const filePath = path.resolve(__dirname, './routes', file);
    const routeModule = require(filePath);

    // 将所有命名导出的数组合并到一个数组中
    return Object.values(routeModule).flat();
  });

export { Routes };
